<html>
<?php 
include 'connexion_bd.php';
session_start();

$rubrique=$_POST["choixrub"];
echo $rubrique;
$login=$_POST["login"];

$req='SELECT id_rub FROM rubriques WHERE nom_rub="'.$rubrique.'"';
$res=mysql_query($req);
$tab=mysql_fetch_row($res);
$nb_rub=$tab[0];
echo $nb_rub;

$requete='INSERT INTO droit VALUES ("'.$login.'","'.$nb_rub.'")';
mysql_query($requete);

?>
</html>